package com.nc.delivery_project.shared.servicelocator;

import com.google.web.bindery.requestfactory.shared.ServiceLocator;
import com.nc.delivery_project.server.service.NaturalPersonService;

/**
 * Created by miroshnik on 1/28/2015.
 */
public class NaturalPersonServiceLocator implements ServiceLocator{
    
    private static NaturalPersonService serviceInstance;

    @Override
    public Object getInstance(Class<?> clazz) {
        return NaturalPersonServiceLocator.getServiceInstance();
    }

    private static NaturalPersonService getServiceInstance() {
        if (serviceInstance == null) {
            serviceInstance = new NaturalPersonService();
        }

        return serviceInstance;
    }
}
